/**
 * @Description 
 * @Version 
 * @Author Dong
 * @Date 2021-03-08 15:43:06
 * @LastEditors Dong
 * @LastEditTime 2021-03-09 09:24:50
 * @FilePath \fed-e-task-04-06\code\work\src\app\store\selectors\todo.selectors.ts
 */
// src\app\store\selectors\todo.selectors.ts
import { createFeatureSelector, createSelector } from '@ngrx/store';
import { AppState } from '..';
import { adapter, State, todoFeatureKey } from '../reducers/todo.reducer';

const { selectIds, selectEntities, selectAll, selectTotal } = adapter.getSelectors();

export const selectTodo = createFeatureSelector<AppState, State>(todoFeatureKey)

// 获取所有的 todo 列表数据
export const selectTodos = createSelector(selectTodo, selectAll)